package com.lishem.loadbalance;

import com.lishem.extension.SPI;
import com.lishem.remoting.dto.RpcRequest;

import java.util.List;

/**
 * 负载均衡策略接口
 */
@SPI
public interface LoadBalance {
    /**
     * 从现有服务地址列表中选择一个
     *
     * @param serviceUrlList 服务地址列表
     * @param rpcRequest
     * @return target service address
     */
    String selectServiceAddress(List<String> serviceUrlList, RpcRequest rpcRequest);
}
